export default function getLineChartOption(title: string, xAxisData: string[], series) {
    const option = {
        tooltip: {
            trigger: 'axis'
        },
        legend: {
            left: 'center',
            bottom: 'bottom'
        },
        grid: {
            top: 'middle',
            left: '3%',
            right: '4%',
            bottom: '3%',
            height: '80%',
            containLabel: true
        },
        xAxis: {
            type: 'category',
            data: xAxisData,
            axisLine: {
                lineStyle: {
                    color: "#999"
                }
            }
        },
        yAxis: {
            type: 'value',
            splitLine: {
                lineStyle: {
                    type: 'dashed',
                    color: '#ddd'
                }
            },
            axisLine: {
                show: false,
                lineStyle: {
                    color: "#999"
                },
            },
            nameTextStyle: {
                color: "#999"
            },
            splitArea: {
                show: false
            }
        },
        series: []
    }
    series.forEach(item => {
        option.series.push({
            name: item.name,
            type: 'line',
            data: item.data,
            lineStyle: {
                normal: {
                    width: 2
                }
            },
            itemStyle: {
                normal: {
                    opacity: 0
                },
                emphasis: {
                    color: '#fff',
                    borderWidth: 3,
                    opacity: 1
                }
            }
        });
    });
    return option;
};